<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%  
response.setHeader("Access-Control-Allow-Origin", "*");  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="no-referrer" />
<title>文章详情·数据工厂</title>
<link href="${pageContext.request.contextPath }/img/webLogoIcon.png"
	rel="shortcut icon">
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/font-awesome.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/animate.css"
	rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/style.css"
	rel="stylesheet">
<!-- FooTable -->
<link href="${pageContext.request.contextPath }/css/footable.core.css"
	rel="stylesheet">
<link
	href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/mypage.css"
	rel="stylesheet">
</head>
<body>
	<div id="wrapper">
		<nav class="navbar-default navbar-static-side" role="navigation">
		
		<%@include file="../components/left.jsp"%> 
		</nav>

		<div id="page-wrapper" class="gray-bg" style="padding-bottom: 40px;">
			<div class="row border-bottom" style="margin-bottom: 20px;">
				<jsp:include page="../components/head.jsp" flush="true" />
			</div>
			<div class="row wrapper border-bottom white-bg page-heading"
				style="margin-bottom: 20px;">
				<div class="col-lg-9">
					<h2>文章详情</h2>
					<ol class="breadcrumb">
						<li class="nav-main1"><a href="${pageContext.request.contextPath}/admin/tosystem_overview">主页</a>
						</li>
						<li class="nav-main2">资讯数据</li>
						<li class="active">文章详情</li>
					</ol>
				</div>
			</div>
					<div class="ibox-content animated fadeInRight" style="padding: 20px;">
						<div class="content-detail" id="list">
							
						</div>
					</div>
			<jsp:include page="../components/footer.jsp" flush="true" />
		</div>
	</div>
	<!-- Mainly scripts -->
	<script src="${pageContext.request.contextPath }/js/jquery-2.1.1.js"></script>
	<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/jquery.metisMenu.js"></script>
	<script
		src="${pageContext.request.contextPath }/js/jquery.slimscroll.min.js"></script>
	<!-- Custom and plugin javascript -->
	<script src="${pageContext.request.contextPath }/js/inspinia.js"></script>
	<script src="${pageContext.request.contextPath }/js/pace.min.js"></script>
	<!-- FooTable -->
	<script
		src="${pageContext.request.contextPath }/js/footable.all.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/mypage.js"></script>
	<!-- Page-Level Scripts -->
	<script>
       
	    		 <% String article_public_id = (String)request.getParameter("article_public_id");%>
	    		    var article_public_id = '<%=article_public_id%>'
	    		detail();
			
		function detail(){
        	$.ajax({
        		url : "${pageContext.request.contextPath}/information/informationDetails-data",
        		type : "post",
        		data:{
        			article_public_id: article_public_id
        		},
        		success : function(res) {
        			$("#list").html('');
        			let json=JSON.parse(res);
        			//var images='';
        			//let img=json.extend_string_one;
        			//if(img!=""){
        			//	let img_json=JSON.parse(img);
        			//	let img_json_array=img_json.imglist;
        			//	for (var i = 0; i < img_json_array.length; i++) {
        			//		images+='<img src="'+img_json_array[i].imgurl+'">';
        			//	}
        			//}
        			var push_time=json.publish_time;
					var push=/\d{4}-\d{1,2}-\d{1,2}/g.exec(push_time);
        			var html='<div class="content-title">'+json.title+'</div>'+
								'<div class="content-tags">'+
									'<span>来源：'+json.sourcewebsitename+'</span>'+
									'<span>时间：'+push+'</span>'+
									'<span><a href="'+json.source_url+'" target="_blank">查看原文</a></span>'+
								'</div>'+
								'<div class="content-con">'+
								//	images+
									json.text+
								'</div>';
        			$("#list").html(html);
        		},
        		error: function(err) {
        			console.log(err)
        		}
        	});
        }
		
		//跑马灯方法 
// 		 function init(){
// 			    //获取标题
// 			    var title=document.title;
// 			    //分割字符串--->字符数组
// 			    var arr=title.split("");
// 			    //删除第一个元素并返回该元素
// 			    var e=arr.shift();
// 			    //把一个对象添加到数组末尾
// 			    arr.push(e);
// 			    //把数组转换成字符串
// 			    var marquee=arr.join("");
// 			    //返回给浏览器
// 			    document.title=marquee;
// 			    //定时一直执行
// 			    window.setTimeout("init()",1000);
// 			}
// 			window.onload=init;
    </script>
</body>
</html>
